<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateKdRepliesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kd_replies', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id');
            $table->integer('classic_cases_id')->nullable()->comment('经典案例id');
            $table->integer('pid')->default(0)->comment('该评论所在的父级id，没有则为0');
            $table->integer('reply_user_id')->default(0)->comment('该评论回复的评论用户id，没有则为0');
            $table->text('original_content')->comment('原始内容');
            $table->text('render_content')->comment('渲染后的内容');
            $table->integer('like_count')->default(0)->comment('点赞人数');
            $table->tinyInteger('status')->default(3)->comment('1拒绝发布,2已发布,3待审核');
            $table->tinyInteger('is_anonymous')->default(-1)->comment('1匿名,-1不匿名');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kd_replies');
    }
}
